/*
 *  MicroEmulator
 *  Copyright (C) 2001 Bartek Teodorczyk <barteo@barteo.net>
 *
 *  It is licensed under the following two licenses as alternatives:
 *    1. GNU Lesser General Public License (the "LGPL") version 2.1 or any newer version
 *    2. Apache License (the "AL") Version 2.0
 *
 *  You may not use this file except in compliance with at least one of
 *  the above two licenses.
 *
 *  You may obtain a copy of the LGPL at
 *      http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
 *
 *  You may obtain a copy of the AL at
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the LGPL or the AL for the specific language governing permissions and
 *  limitations.
 */
 
package org.microemu.device;


public interface InputMethodListener
{

	public void caretPositionChanged(InputMethodEvent event);
	
    /**
     * Move text caret to the end of the current line of text..
     * @param shiftKeyIsDown true if SHIFT key is down; false otherwise.
     * 
     * BlueWhaleSystems fix: Ramesh Nair - 14-15 May 2008
     */
    public void moveCaretToEndOfLine(boolean shiftKeyIsDown);

    /**
     * Move text caret to the beginning of the current line of text.
     * @param shiftKeyIsDown true if SHIFT key is down; false otherwise.
     * 
     * BlueWhaleSystems fix: Ramesh Nair - 14-15 May 2008
     */
    public void moveCaretToBeginningOfLine(boolean shiftKeyIsDown);
    
	/**
	 * Move text caret up one row of text.
	 * @param shiftKeyIsDown true if SHIFT key is down; false otherwise.
     * @return false if already at top row of text or this operation isn't 
	 * supported.
	 * 
     * BlueWhaleSystems fix: Ramesh Nair - 9,13 May 2008
	 */
	public boolean moveCaretUp(boolean shiftKeyIsDown);

    /**
     * Move text caret down one row of text.
     * @param shiftKeyIsDown true if SHIFT key is down; false otherwise.
     * @return false if already at bottom row of text or this operation isn't 
     * supported.
     * 
     * BlueWhaleSystems fix: Ramesh Nair - 9,13 May 2008
     */
    public boolean moveCaretDown(boolean shiftKeyIsDown);

    /**
     * Move text caret one character to the left.
     * @param shiftKeyIsDown true if SHIFT key is down; false otherwise.
     * 
     * BlueWhaleSystems fix: Ramesh Nair - 13 May 2008
     */
    public void moveCaretLeft(boolean shiftKeyIsDown);

    /**
     * Move text caret one character to the right.
     * @param shiftKeyIsDown true if SHIFT key is down; false otherwise.
     * 
     * BlueWhaleSystems fix: Ramesh Nair - 13 May 2008
     */
    public void moveCaretRight(boolean shiftKeyIsDown);

    /**
     * Shift key has been released.
     * 
     * BlueWhaleSystems fix: Ramesh Nair - 13 May 2008
     */
    public void shiftKeyIsUp();
    

	public void inputMethodTextChanged(InputMethodEvent event);

	public int getCaretPosition();
	
	/**
	 * Returns the plaintext of the inputMethodListener. 
	 * BlueWhaleSystems comment
	 * 
	 * @return The plaintext of the inputMethodListener.
	 */
	public String getText();
    
	
    /**
     * Highlight all the text in the component in one go.
     * 
     * BlueWhaleSystems fix: Ramesh Nair - 19 May 2008
     */     
    public void highlightAllText();	
	
	
    /**
     * Get the currently highlighted text.
     * 
     * @return null if no text is currently highlighted.
     * 
     * BlueWhaleSystems fix: Ramesh Nair - 14 May 2008
     *
     * For clipboard actions we need access to the highlighted text.
     */ 	
    public String getHighlightedText();

    
    /**
     * Delete the currently highlighted text.
     * 
     * BlueWhaleSystems fix: Ramesh Nair - 14 May 2008
     */     
    public void deleteHighlightedText();
    
    public int getConstraints();
	
    /**
     * Get whether to newline characters should not be processed.
     * 
     * BlueWhaleSystems fix: Ramesh Nair - 9 May 2008 
     */
    public boolean dontAllowNewLineChar();
}
